home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / MATHEMAT / STATISTI / 0910.ZIP / OCTA.DOC < prev    next >
Text File  |  1987-01-15  |  16KB  |  449 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                                      OCTA
  10.                      Oneman's Contingency Table Analysis
  11.                                    (c) 1987
  12.  
  13.                         "One of many STATOOLS(tm)..."
  14.                                       by
  15.  
  16.                               Gerard E. Dallal
  17.                               53 Beltran Street
  18.                               Malden, MA  02148
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.              (O)neman's (C)ontingency (T)able (A)nalysis is a program
  30.         for the log-linear analysis of multi-dimensional  contingency
  31.         tables  by  use  of the Deming-Stephan iterative proportional
  32.         fitting procedure described in Bishop, Fienberg,  and Holland
  33.         (1975) and Fienberg (1980).
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.                                   DISCLAIMER
  42.  
  43.              STATOOLS(tm) are provided "as is"  without  warranty  of
  44.         any  kind.  The  entire risk as to the quality,  performance,
  45.         and fitness for intended purpose  is  with  you.  You  assume
  46.         responsibility  for  the selection of the program and for the
  47.         use of results obtained from that program.
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.                                                                PAGE 2
  61.  
  62.  
  63.         
  64.              Oneman's  Contingency Table Analysis (OCTA) is a program
  65.         for the log-linear analysis of multi-dimensional  contingency
  66.         tables  by  use  of the Deming-Stephan iterative proportional
  67.         fitting procedure described in Bishop, Fienberg,  and Holland
  68.         (1975) and, for a more general audience, Fienberg (1980).
  69.  
  70.              Only the first two letters of a command need be entered.
  71.  
  72.         ENTER   -- enter contingency table
  73.         TABLE   -- get table from OCTA system file
  74.         SAVE    -- save table in OCTA system file
  75.         EDIT    -- edit contingency table
  76.  
  77.         MODEL   -- specify model
  78.         ALL     -- all models (three way tables only)
  79.         PM      -- compute partial and marginal associations
  80.         ISOLATE -- isolated cell; structural zero; quasi-independence
  81.         DELTA   -- specify a constant to be added to all cell counts
  82.         INITIAL -- specify initial values
  83.  
  84.         MARGIN  -- construct marginal table
  85.         STRATUM -- extract a stratum
  86.  
  87.         SP      -- select printing options
  88.         PRINT   -- print
  89.         MESSAGE -- message
  90.         QUIT    -- quit
  91.  
  92.  
  93.  
  94.                                DATA MANAGEMENT
  95.  
  96.              The  ENTER  command initiates data entry.  Tables may be
  97.         saved by use of the SAVE command and  recovered,  during  the
  98.         same  or  subsequent  sessions,  by use of the TABLE command.
  99.         The EDIT command can be used to change  any  portion  of  the
  100.         table.
  101.  
  102.  
  103.  
  104.                                 FITTING MODELS
  105.  
  106.              The MODEL command is used to fit hierarchical log-linear
  107.         models  to  the  table.  A model is specified by entering its
  108.         minimal set of sufficient  configurations.  To  obtain  these
  109.         configurations,  write down the terms of the log-linear model
  110.  
  111.  
  112.         OCTA                                              G.E. Dallal
  113.  
  114.  
  115.  
  116.                                                                PAGE 3
  117.  
  118.  
  119.         and delete any term whose indices are a proper subset of  the
  120.         indices  of  any  other term in the model.  The collection of
  121.         indices of those terms that remain form the  minimal  set  of
  122.         sufficient configurations for the model.
  123.  
  124.              A   model   must   be   typed  on  a  single  line  with
  125.         configurations separated by one or  more  blanks  or  commas.
  126.         The  MODEL  command  generates its own prompt,  MODEL>.  OCTA
  127.         keeps returning to this prompt until an empty  line  (Return)
  128.         is entered.
  129.  
  130.            Example:  consider  the  four-dimensional  table  with
  131.            factors W,  U,  S,  and B when the model to be  fitted
  132.            contains all two factor interactions and the USB three
  133.            factor interaction.  The model contains the terms
  134.  
  135.                         W U S B WU WS WB US UB SB USB
  136.  
  137.            W is eliminated as a subset of WU, US is eliminated as
  138.            a subset of USB, and so on, leaving
  139.  
  140.                                  WU WS WB USB
  141.  
  142.            as  the  minimal  set  of  sufficient  configurations.
  143.            These configurations are entered at the MODEL> prompt:
  144.  
  145.                             OCTA>MODEL
  146.                             MODEL>WU WS WB USB
  147.                               .
  148.                               .       [output]
  149.                               .
  150.                             MODEL> <Return>
  151.                             OCTA>
  152.  
  153.              The fitting procedure aborts automatically if  a  fitted
  154.         value of zero is obtained.
  155.  
  156.              The  ALL  command  fits  all possible models to a three-
  157.         dimensional table.
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.         OCTA                                              G.E. Dallal
  169.  
  170.  
  171.  
  172.                                                                PAGE 4
  173.  
  174.  
  175.                                CONVERGENCE
  176.  
  177.              Iteration stops whenever the largest absolute difference
  178.         between an observed and fitted entry in the set of sufficient
  179.         configurations is less than 0.01 or the largest ratio of  the
  180.         absolute  difference  to  the  observed  entry  is  less than
  181.         0.0001.
  182.  
  183.  
  184.  
  185.                 PARAMETER ESTIMATES AND THEIR STANDARD ERRORS
  186.  
  187.              Parameters  of  the  log-linear  model  are estimated by
  188.         applying the usual analysis of variance methods to  the  logs
  189.         of  the  expected  cell counts.  The reported standard errors
  190.         are the asymptotic mle's of the errors for the parameters  of
  191.         a saturated model,  that is,  a model containing all terms of
  192.         all orders.  Lee (1977) suggests that these are often  likely
  193.         to  be  be  overestimates of the true standard errors.  These
  194.         estimates are undefined if any of the cell counts is zero.
  195.  
  196.  
  197.  
  198.                        PARTIAL AND MARGINAL ASSOCIATION
  199.  
  200.              The  PM  command  gives  tests  of  partial and multiple
  201.         association  (Brown,   1976).   To  illustrate  for  the  USB
  202.         interaction  in  the  example  above,  the  test  of  partial
  203.         association is the difference between  the  likelihood  ratio
  204.         statistic  for  the  model with all three factor interactions
  205.         except USB and the likelihood ratio statistic for  the  model
  206.         with  all  three  factor interactions.  The test for marginal
  207.         association is the difference between  the  likelihood  ratio
  208.         statistic  for  the  model with sufficient configurations US,
  209.         UB,  SB and the likelihood ratio statistic for the model with
  210.         sufficient  configuration  USB,  that is,  the model with all
  211.         effects implied by USB other than USB itself  and  the  model
  212.         with all effects implied by USB.
  213.  
  214.              If both tests are significant, then the term is probably
  215.         needed  to  build  an  adequate  model.  If  both  tests  are
  216.         nonsignificant,  the  term can probably be safely eliminated.
  217.         If one test is significant while the other  is  not,  further
  218.         investigation is required.
  219.  
  220.              The PM command gives no warning when a fitted value of 0
  221.         is obtained.
  222.  
  223.  
  224.         OCTA                                              G.E. Dallal
  225.  
  226.  
  227.  
  228.                                                                PAGE 5
  229.  
  230.  
  231.                               QUASI-INDEPENDENCE
  232.  
  233.              The  ISOLATE  command  is used to fit quasi-independence
  234.         models.  Upon entry of the ISOLATE command, OCTA asks for the
  235.         indices of the cells to which fitted models will  not  apply.
  236.         Such cells are called isolated or separated.
  237.  
  238.              The  calculation  of  the  degrees  of  freedom  of  the
  239.         reference  distribution  for  the likelihood ratio statistics
  240.         for these models is complex (Fienberg,  1980,  section  8.3),
  241.         They are a function of both the pattern of isolated cells and
  242.         the  particular  model  under  consideration.  The degrees of
  243.         freedom for a quasi-independence are equal to (the degrees of
  244.         freedom for the model  for  the  complete  table)  plus  (the
  245.         number  of  parameters  in  the complete model that cannot be
  246.         estimated due to the pattern of isolated  cells)  minus  (the
  247.         number  of  isolated  cells).  The computational difficulties
  248.         arise from the determination of  the  number  of  unestimable
  249.         parameters.  OCTA  assumes  that  this  number  is  zero  and
  250.         computes the degrees of freedom as (the  degrees  of  freedom
  251.         for the complete model) minus (the number of isolated cells).
  252.         The  results  are labelled (quasi-independence) to remind the
  253.         user that they are computed subject to this rule.
  254.  
  255.  
  256.  
  257.                      ANALYZING MARGINAL TABLES AND STRATA
  258.  
  259.              MARGIN forms marginal  tables  of  the  original  table.
  260.         These  tables  may be subjected to further analysis by use of
  261.         the SAVE and TABLE commands.  MARGIN  may  also  be  used  to
  262.         permute  the  original table for display purposes by entering
  263.         the highest order interaction with the  variables  listed  in
  264.         the  order  in  which they are to appear in the display.  The
  265.         first variable forms the columns of the display,  the  second
  266.         the  rows,  the  third  the  fastest  varying variable across
  267.         tables, and so on.
  268.  
  269.              The STRATUM command allows a stratum defined  by  up  to
  270.         all but one of the original variables to be displayed,  SAVEd
  271.         and analyzed (TABLE).
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.         OCTA                                              G.E. Dallal
  281.  
  282.  
  283.  
  284.                                                                PAGE 6
  285.  
  286.  
  287.                             DISPLAYING RESULTS
  288.  
  289.              ["Printing" refers to "displaying to screen".  For  hard
  290.         copy,  use  the Shift-PrtSc combination to print the contents
  291.         of the screen or the  Ctrl-PrtSc  combination  to  print  all
  292.         subsequent information displayed on the screen.]
  293.  
  294.              The  SP (Set Print options) command lets the user choose
  295.         between  three  types  of  residuals   (simple   differences,
  296.         standardized  residuals,   and  Freeman-Tukey  deviates)  and
  297.         display (1) a table of observed counts, expected counts,  and
  298.         residuals,  (2)  a normal plot of the residuals,  and (3) the
  299.         effects of the log-linear model  along  with  their  standard
  300.         errors  (see  below).  The default is to print only the table
  301.         (1) with standardized residuals.  The PRINT command generates
  302.         the display.
  303.  
  304.              When a quasi-independence model is fitted,  the observed
  305.         counts,  expected  counts,  and  residuals for isolated cells
  306.         appear as -99;  the effects of the log-linear model  are  not
  307.         estimated or displayed.
  308.  
  309.  
  310.  
  311.                                 OTHER OPTIONS
  312.  
  313.              DELTA allows a constant (typically 0.5) to be  added  to
  314.         each   cell   count.   Successive  calls  to  DELTA  are  NOT
  315.         cumulative.  All changes  are  based  on  the  original  cell
  316.         counts.
  317.  
  318.              INITIAL  allows  a  table  of  initial  values   to   be
  319.         specified.  Any interactions that are present in the table of
  320.         initial values will be present in the table of fitted values.
  321.         If  a table of initial values contains anything but zeros and
  322.         a common  nonzero  constant  (another  method  of  specifying
  323.         quasi-independence  models),  only the expected values should
  324.         be used.  Any test statistics  coaxed  out  of  OCTA  do  not
  325.         measure what they appear to measure.
  326.  
  327.  
  328.  
  329.                      INTERACTION BETWEEN QUASI, DELTA
  330.                               AND OTHER COMMANDS
  331.  
  332.              Requests for marginal tables or strata undo designations
  333.         of isolated cells but will not affect added constants.
  334.  
  335.  
  336.         OCTA                                              G.E. Dallal
  337.  
  338.  
  339.  
  340.                                                                PAGE 7
  341.  
  342.  
  343.  
  344.              Reentering the TABLE command will restore a table to its
  345.         original values, as will a call to DELTA with an increment of
  346.         0,  but  the TABLE command will undo designations of isolated
  347.         cells while DELTA with an increment of 0 will not.
  348.  
  349.              The PM command removes designations  of  isolated  cells
  350.         before it is carried out;  the ALL command does not.  Neither
  351.         command affects added constants.
  352.  
  353.              Expected values and residuals are printed along with the
  354.         cell counts when the PRINT command is issued  after  a  model
  355.         has  been fitted.  When several models have been fitted,  the
  356.         expected values and residuals apply to the most recent model.
  357.         Only cell counts are printed  when  a  PM,  ALL,  or  ISOLATE
  358.         command  intervenes  between  the  MODEL  and PRINT commands.
  359.         or when there is no prior MODEL command.
  360.  
  361.  
  362.  
  363.                               PERMISSION TO COPY
  364.  
  365.              Individuals and not-for-profit organizations are granted
  366.         permission  to  freely  copy  this  program and documentation
  367.         provided
  368.  
  369.              --   no price is charged, and
  370.  
  371.              --   the   diskette,   containing   both   program   and
  372.                   documentation, is not modified in any way.
  373.  
  374.              BBS's  and  software  libraries  may  add  OCTA to their
  375.         collection  upon  receipt  of  written  permission  from  the
  376.         author.  Under  no  circumstances  may  OCTA be duplicated or
  377.         circulated as part of ANY OTHER commercial venture.
  378.  
  379.  
  380.  
  381.                                    USER FEE
  382.  
  383.              If  you  find OCTA to be of use to you,  a user's fee of
  384.         $10 is requested.  OCTA should be treated like  a  book:  Any
  385.         number  of  individuals  may use a single copy of OCTA on any
  386.         number of machines provided only one user is using it on  one
  387.         machine at any one time.
  388.  
  389.  
  390.  
  391.  
  392.         OCTA                                              G.E. Dallal
  393.  
  394.  
  395.  
  396.                                                                PAGE 8
  397.  
  398.  
  399.                                   ALGORITHMS
  400.  
  401.         OCTA makes use of the following published routines:
  402.  
  403.         Haberman, S.J.  (1972).  Algorithm AS 51:  Log-linear fit for
  404.            contingency tables.  Applied Statistics, 21, 218-225.
  405.  
  406.         Hill,  I.D.  (1973).  Algorithm AS 66.  The normal  integral.
  407.            Applied Statistics, 22, 424-427.
  408.  
  409.         Lustbader, E.D.  and Stodola, R.K. (1981).  Algorithm AS 160:
  410.            Partial  and  marginal  association  in   multidimensional
  411.            contingency tables.  Applied Statistics, 30, 97-105.
  412.  
  413.         Odeh,  R.E.  and  J.O.  Evans  (1974).  Algorithm AS 70.  The
  414.            percentage points  of  the  normal  distribution.  Applied
  415.            Statistics, 23, 96-97.
  416.  
  417.         and the author's FORTRAN translation of
  418.  
  419.         Pike, M.C.  and I.D.  Hill (1966).  Algorithm 291.  Logarithm
  420.            of the gamma function.  Communications of the ACM, 9, 684.
  421.  
  422.  
  423.  
  424.                                   REFERENCES
  425.  
  426.         Bishop, Y.M.M.,  Fienberg,  S.E.,  and Holland,  P.W. (1975),
  427.            Discrete  Multivariate  Analysis:   Theory  and  Practice,
  428.            Cambridge, MA: The MIT Press.
  429.  
  430.         Brown,  M.B.  (1976),  "Screening Effects in Multidimensional
  431.            Contingency Tables," Applied Statistics, 25, 37-46.
  432.  
  433.         Fienberg,   S.E. (1980),  The  Analysis  of  Cross-Classified
  434.            Categorical Data, 2nd ed, Cambridge, MA: The MIT Press.
  435.  
  436.         Lee, S.K. (1977).  "On the Asymptotic Variances of u Terms in
  437.            Loglinear Models of Multi-dimensional Contingency Tables,"
  438.            Journal of the American Statistical Association,  72, 412-
  439.            419.
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.         OCTA                                              G.E. Dallal
  449.